package org.rc.model;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: dokeeffe
 * Date: 04/02/2012
 * Time: 14:46
 *
 * A search term that has been searched for by a human. 
 * Stored in the datastore
 */
public class SearchTerm implements Serializable {

    @Id
    private Long id;

    /**
     * String searched for
     */
    private String term;

    /**
     * The date of search. Default to now
     */
    private Date date = new Date();

    /**
     * A link to the result of the search
     */
    private String link;

    /**
     * No arg constructor
     */
    public SearchTerm() {
    }

    /**
     * Constructor passed the search term.
     * @param search
     */
    public SearchTerm(String search) {
        this.term = search;
    }
    
    /**
     * Constructor passed the search term.
     * @param search
     */
    public SearchTerm(String search, String link) {
        this.term = search;
        this.setLink(link);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTerm() {
        return term;
    }

    public void setTerm(String term) {
        this.term = term;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }
}
